namespace LS.Digitize
{
    public struct ReadObjectScope: IScope
    {
        public IReader Reader { get; private set; }
        public bool ReadFailure { get; private set; }
        public ReadObjectScope(IReader reader)
        {
            string name = null;
            Reader = reader;
            ReadFailure = !reader.StartReadObject();
        }
        
        public void Dispose()
        {
            Reader.EndReadObject();
            Reader = null;
        }
    }
}